import request from '@/axios'
import type { ListParams, Response } from '@/api/api'

export interface Row {
  id?: String
  store_id: String
  goods_id: string
  goods_rule_id: string
  money: string
}

// 预存款列表
export const getListApi = (data: ListParams): Promise<Response<Row>> => {
  return request.post({ url: '/store/amount/list', data })
}
// 预存款新增
export const createApi = (data: Partial<Row>): Promise<IResponse> => {
  return request.post({ url: '/store/amount/create', data })
}

// 预存款删除
export const delApi = (data: { id: string }): Promise<IResponse> => {
  return request.post({ url: '/store/amount/del', data })
}

// 禁用
export const stopApi = (params): Promise<IResponse> => {
  return request.get({ url: '/store/amount/stop', params })
}

// 启用
export const startApi = (params): Promise<IResponse> => {
  return request.get({ url: '/store/amount/start', params })
}
